﻿@{
    ViewBag.Title = "商城信息详情";
    Layout = null;
}

<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <title>商城信息详情</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, minimum-scale= 1.0, initial-scale= 1.0">
    <link href="~/Content/Style/conmon.css" rel="stylesheet" type="text/css">
    <link href="~/Content/fonts/iconfont.css" rel="stylesheet" type="text/css">

    <style>
        .rating-wrapper {
        }

            .rating-wrapper .rating-item {
                display: flex;
            }

                .rating-wrapper .rating-item .content_sum {
                    padding: 10px 0;
                    position: relative;
                    flex: 1;
                }

                    .rating-wrapper .rating-item .content_sum .text {
                        margin-bottom: 8px;
                        line-height: 18px;
                        color: rgba(0,0,0,.54);
                        font-size: 12px;
                        overflow: hidden;
                        text-overflow: ellipsis;
                        display: -webkit-box;
                        -webkit-line-clamp: 3;
                        -webkit-box-orient: vertical;
                        padding-left: 40px;
                        float: left;
                    }

                    .rating-wrapper .rating-item .content_sum .content_lb {
                        clear: both;
                        padding: 0 5px;
                    }

                        .rating-wrapper .rating-item .content_sum .content_lb img {
                            width: 100% !important;
                        }

        .content .title {
            padding-bottom: 10px;
            text-align: center;
            font-size: 18px;
            border-bottom: 1px solid rgba(7, 17, 27, 0.1);
        }
    </style>
</head>

<body>
    <div id="app">
        <div class="Details">
            <div class="rating-wrapper content">
                <ul>
                    <li class="rating-item">
                        <div class="content_sum">
                            <h1 class="title" v-if="Details[0]">{{Details[0].Title}}</h1>
                            <div class="text">类型：<span v-if="Details[0]" v-html="ChangeInformationType(Details[0].Type)" readonly></span></div>
                            <div class="text">时间：<span v-if="Details[0]" v-html="ChangeInformationTime(Details[0].UpdateTime)" readonly></span></div>
                            <div class="content_lb" v-if="dada===0 && Details[0]" v-html="Details[0].Contents"></div>
                        </div>
                    </li>
                </ul>
            </div>
        </div>

        <footer>
            <div class="footer_box">
                <div class="footer_li">
                    <a href="/">
                        <div class="footer-img">
                            <i class="iconfont icon-union" style="font-size: 28px;"></i>
                        </div>
                        <span>首页</span>
                    </a>
                </div>
                <div class="footer_li">
                    <a href="/Classification/Index">
                        <div class="footer-img">
                            <i class="iconfont icon-dingdan1" style="font-size: 28px;"></i>
                        </div>
                        <span>分类</span>
                    </a>
                </div>
                <div class="footer_li">
                    <a href="/ShoppingCart/Index">
                        <div class="footer-img">
                            <i class="iconfont icon-gouwuche4" style="font-size: 28px;"></i>
                        </div>
                        <span>购物车</span>
                    </a>
                </div>
                <div class="footer_li">
                    <a href="/Information/Index">
                        <div class="footer-img">
                            <i class="iconfont icon-wode1" style="font-size: 28px;"></i>
                        </div>
                        <span>个人中心</span>
                    </a>
                </div>
            </div>
        </footer>
    </div>

    <script src="~/Content/Script/jquery-1.8.3.min.js"></script>
    <!-- 引入 Vue -->
    <script src="https://unpkg.com/vue"></script>

    <script>
        Vue.config.productionTip = false;   //Vue去掉警告 You are running Vue in development mode
        var vm = new Vue({
            el: '#app',
            data() {
                return {
                    dada: 0,
                    currentIndex: 2,
                    Details: '',
                };
            },
            created() {
                var _this = this;
                var GetRequest = new GetRequest();
                function GetRequest() {
                    var url = location.search; //获取url中"?"符后的字串
                    var theRequest = new Object();
                    if (url.indexOf("?") != -1) {
                        var str = url.substr(1);
                        strs = str.split("&");
                        for (var i = 0; i < strs.length; i++) {
                            theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
                        }
                    }
                    return theRequest;
                }
                $.ajax({
                    url: "/Information/Details_Order_Information",
                    type: "POST",
                    dataType: "json",
                    data: { InformationID: GetRequest.InformationID, YZM: '', RETID: 1 },
                    success: function (data) {
                        vm.Details = data.rows;
                        console.log(data);
                    }
                });
            },
            methods: {
                ChangeInformationType(Type) {
                    if (Type == 1) {
                        Type = "通知";
                    }
                    else if (Type == 2) {
                        Type = "促销活动";
                    }
                    else if (Type == 3) {
                        Type = "帮助";
                    }
                    else {
                        Type = "";
                    }
                    return Type;
                },
                ChangeInformationTime(Time) {
                    if (Time != "" || Time != null) {
                        var date_str = Time.replace(/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/g, '$1-$2-$3  $4:$5');
                        return date_str;
                        //console.log(date_str);
                    }
                }
            }
        });
    </script>
</body>
</html>
